]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shellDBus: Add new BrightnessChanged signal to brightness interface
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 24 Nov 2025 16:16:57 +0000 (17:16 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 14 Jan 2026 18:14:59 +0000 (19:14 +0100)
This does actually track user-triggered changes, so other pieces
(i.e. gsd-power) can react to this. This will help in reintroducing
brightness re-normalization when brightness is driven by ALS sensors.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3979>
(cherry picked from commit 8e1d63029a5a999a65402157cda2ca503eb3866c)

data/dbus-interfaces/org.gnome.Shell.Brightness.xml
js/ui/shellDBus.js

index a0e63972863836290fdc94414c34274ebe46fc9c..9bfed250522e714ea4b33ed1942c6bf49e1808d0 100644 (file)
     -->
     <property name="HasBrightnessControl" type="b" access="read"/>
 
+    <!--
+        BrightnessChanged:
+
+        Brightness was changed by the user.
+    -->
+    <signal name="BrightnessChanged" />
+
   </interface>
 </node>
index 3c6bc3fff20849e19dc3684e3142f1f9f7092bc4..9b2ff24d4c2b6b36bb604e9bd587cb82cb1553c1 100644 (file)
@@ -602,7 +602,10 @@ export class BrightnessDBus {
         Gio.DBus.session.own_name('org.gnome.Shell.Brightness',
             Gio.BusNameOwnerFlags.NONE, null, null);
 
-        this._manager.connectObject('changed', this._sync.bind(this), this);
+        this._manager.connectObject(
+            'changed', () => this._sync(),
+            'user-update', () => this._userChange(),
+            this);
         this._sync();
     }
 
@@ -616,6 +619,10 @@ export class BrightnessDBus {
             new GLib.Variant('b', this._hasBrightnessControl));
     }
 
+    _userChange() {
+        this._dbusImpl.emit_signal('BrightnessChanged', null);
+    }
+
     SetDimming(enable) {
         this._manager.dimming = enable;
     }